<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>title</title>
    <script th:src="@{/static/js/jquery.min.js}"></script>
    <script th:src="@{/static/bootstrap-3.4.1-dist/js/bootstrap.js}"></script>
    <link rel="stylesheet" th:href="@{/static/bootstrap-3.4.1-dist/css/bootstrap.css}">
</head>
<body>
<div class="container">
    <h3>user's edit page</h3>
    <hr>
    <form th:action="@{/user/edit}" method="post" autocomplete="off">
        <input type="hidden" name="userId" th:value="${user.userId}">

        <div class="form-group">
            <label for="userName">姓名</label>
            <input type="text" class="form-control" id="userName" name="userName" th:value="${user.userName}" placeholder="姓名">
        </div>

        <div class="form-group">
            <label for="deptId">部门城市</label>
            <select id="deptId" name="deptId" class="form-control">
                <div th:each="dept: ${deptList}">
                    <option th:selected="${dept.deptId}==${user.dept.deptId}" th:value="${dept.deptId}" th:text="${dept.deptName}"></option>
                </div>

            </select>
        </div>

        <button type="submit" class="btn btn-default">修改</button>
    </form>

</div>

</body>
</html>